import { onActivated } from 'vue'
import $Store from '@/store'

export default function useActivated(callback: { (): void }) {
  onActivated(() => {
    if ($Store.getters.clearCache && callback) {
      callback()
      $Store.dispatch('permission/setClearCache', false)
    }
  })
}
